package com.wuliupai.delivery.wuliupaidelivery.activity;

import android.widget.ImageView;
import android.widget.TextView;

import com.wuliupai.delivery.wuliupaidelivery.R;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.Extra;
import org.androidannotations.annotations.ViewById;

/**
 * 余额充值 和提现成功界面 成功界面
 */
@EActivity(R.layout.activity_wallet_balanet_success)
public class WalletBalanetSuccessActivity extends AppBaseActivity {

    @Extra("PagerType") // 界面类型 (0)充值成功 (1)提现成功
            int PagerType;

    /*@Extra("QuickDeposit") //是否快速提现 true(是) fales(否)
    boolean QuickDeposit;*/

    @Extra("bankCard") // 银行卡 信息
            String bankCard;

    @Extra("balance") // 金额remaining balance
            String balance;

    @ViewById(R.id.iv_wallet_balanet_success)
    ImageView iv_wallet_balanet_success; // 提现或充值成功图片
    @ViewById(R.id.tv_wallet_balanet_success)
    TextView tv_wallet_balanet_success; // 提现或充值成功信息
    @ViewById(R.id.tv_wallet_balanet_success_bank_card)
    TextView tv_wallet_balanet_success_bank_card; // 提现或充值 的银行卡
    @ViewById(R.id.tv_wallet_balanet_success_figure)
    TextView tv_wallet_balanet_success_figure; // 提现或充值 金额
    @ViewById(R.id.tv_wallet_balanet_success_money)
    TextView tv_wallet_balanet_success_money; //充值金额 提现金额


    @Click(R.id.btn_My_Wallet_balanet_success)
    void ClickSuccess() {
        finish();
    }

    @AfterViews
    void startView() {
        initView(PagerType);
    }

    /**
     * 初始化界面
     */
    private void initView(int pagerType) {

        //设置界面 title
        if (pagerType == 0) { //充值成功界面
            setDefaultTitle(this, R.string.strings_my_wallet_balanet_success);
            iv_wallet_balanet_success.setImageResource(R.mipmap.topup_successful);
            tv_wallet_balanet_success.setText(R.string.strings_my_wallet_security_success);
            tv_wallet_balanet_success_money.setText(R.string.strings_my_wallet_balanet_money_success);
            tv_wallet_balanet_success_bank_card.setText(bankCard);
            tv_wallet_balanet_success_figure.setText(balance);

        } else if (pagerType == 1) { //提现成功界面
            setDefaultTitle(this, R.string.strings_my_wallet_balanet_withdraw);
            iv_wallet_balanet_success.setImageResource(R.mipmap.topup_time);
           /* if (QuickDeposit){ //显示快速提现
                tv_wallet_balanet_success.setText(R.string.strings_my_wallet_quick_withdraw_deposit_success);
            }else {*/ //显示普通提现
            tv_wallet_balanet_success.setText(R.string.strings_my_wallet_withdraw_deposit_success);
            /*}*/
            tv_wallet_balanet_success_money.setText(R.string.strings_my_wallet_balanet_withdraw_success);
            tv_wallet_balanet_success_bank_card.setText(bankCard);
            tv_wallet_balanet_success_figure.setText(balance);
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
